\(\int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx\) [1223]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-2)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 406 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=-\frac {\left (6 a^2 b^2 c \left (c^2-3 d^2\right )-b^4 c \left (c^2-3 d^2\right )-4 a^3 b d \left (3 c^2-d^2\right )+4 a b^3 d \left (3 c^2-d^2\right )-a^4 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (4 a^3 b c \left (c^2-3 d^2\right )-4 a b^3 c \left (c^2-3 d^2\right )+6 a^2 b^2 d \left (3 c^2-d^2\right )-b^4 d \left (3 c^2-d^2\right )-a^4 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac {(b c-a d)^2 \left (a^2 d^2 \left (3 c^2-d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3 f}-\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d)^3 \left (2 a c d+b \left (c^2+3 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \]

[Out]

-(6*a^2*b^2*c*(c^2-3*d^2)-b^4*c*(c^2-3*d^2)-4*a^3*b*d*(3*c^2-d^2)+4*a*b^3*d*(3*c^2-d^2)-a^4*(c^3-3*c*d^2))*x/(
c^2+d^2)^3-(4*a^3*b*c*(c^2-3*d^2)-4*a*b^3*c*(c^2-3*d^2)+6*a^2*b^2*d*(3*c^2-d^2)-b^4*d*(3*c^2-d^2)-a^4*(3*c^2*d
-d^3))*ln(cos(f*x+e))/(c^2+d^2)^3/f+(-a*d+b*c)^2*(a^2*d^2*(3*c^2-d^2)+2*a*b*c*d*(c^2+5*d^2)+b^2*(c^4+3*c^2*d^2
+6*d^4))*ln(c+d*tan(f*x+e))/d^3/(c^2+d^2)^3/f-1/2*(-a*d+b*c)^2*(a+b*tan(f*x+e))^2/d/(c^2+d^2)/f/(c+d*tan(f*x+e
))^2+(-a*d+b*c)^3*(2*a*c*d+b*(c^2+3*d^2))/d^3/(c^2+d^2)^2/f/(c+d*tan(f*x+e))

Rubi [A] (verified)

Time = 0.86 (sec) , antiderivative size = 406, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3646, 3716, 3707, 3698, 31, 3556} \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\frac {\left (a^2 d^2 \left (3 c^2-d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right ) (b c-a d)^2 \log (c+d \tan (e+f x))}{d^3 f \left (c^2+d^2\right )^3}-\frac {\left (-\left (a^4 \left (3 c^2 d-d^3\right )\right )+4 a^3 b c \left (c^2-3 d^2\right )+6 a^2 b^2 d \left (3 c^2-d^2\right )-4 a b^3 c \left (c^2-3 d^2\right )-b^4 d \left (3 c^2-d^2\right )\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )^3}-\frac {x \left (-\left (a^4 \left (c^3-3 c d^2\right )\right )-4 a^3 b d \left (3 c^2-d^2\right )+6 a^2 b^2 c \left (c^2-3 d^2\right )+4 a b^3 d \left (3 c^2-d^2\right )-b^4 c \left (c^2-3 d^2\right )\right )}{\left (c^2+d^2\right )^3}-\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}+\frac {\left (2 a c d+b \left (c^2+3 d^2\right )\right ) (b c-a d)^3}{d^3 f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))} \]

[In]

Int[(a + b*Tan[e + f*x])^4/(c + d*Tan[e + f*x])^3,x]

[Out]

-(((6*a^2*b^2*c*(c^2 - 3*d^2) - b^4*c*(c^2 - 3*d^2) - 4*a^3*b*d*(3*c^2 - d^2) + 4*a*b^3*d*(3*c^2 - d^2) - a^4*
(c^3 - 3*c*d^2))*x)/(c^2 + d^2)^3) - ((4*a^3*b*c*(c^2 - 3*d^2) - 4*a*b^3*c*(c^2 - 3*d^2) + 6*a^2*b^2*d*(3*c^2
- d^2) - b^4*d*(3*c^2 - d^2) - a^4*(3*c^2*d - d^3))*Log[Cos[e + f*x]])/((c^2 + d^2)^3*f) + ((b*c - a*d)^2*(a^2
*d^2*(3*c^2 - d^2) + 2*a*b*c*d*(c^2 + 5*d^2) + b^2*(c^4 + 3*c^2*d^2 + 6*d^4))*Log[c + d*Tan[e + f*x]])/(d^3*(c
^2 + d^2)^3*f) - ((b*c - a*d)^2*(a + b*Tan[e + f*x])^2)/(2*d*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) + ((b*c - a
*d)^3*(2*a*c*d + b*(c^2 + 3*d^2)))/(d^3*(c^2 + d^2)^2*f*(c + d*Tan[e + f*x]))

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3646

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b*c - a*d)^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - D
ist[1/(d*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a^2*d*(b*d*(
m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c*(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3
*a*b^2*d)*Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*(n + 1)))*Tan[e + f*x]^2, x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && Gt
Q[m, 2] && LtQ[n, -1] && IntegerQ[2*m]

Rule 3698

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 3707

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rule 3716

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(c^2*C - B*c*d + A*d^2)
*((c + d*Tan[e + f*x])^(n + 1)/(d^2*f*(n + 1)*(c^2 + d^2))), x] + Dist[1/(d*(c^2 + d^2)), Int[(c + d*Tan[e + f
*x])^(n + 1)*Simp[a*d*(A*c - c*C + B*d) + b*(c^2*C - B*c*d + A*d^2) + d*(A*b*c + a*B*c - b*c*C - a*A*d + b*B*d
 + a*C*d)*Tan[e + f*x] + b*C*(c^2 + d^2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] &
& NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && LtQ[n, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {\int \frac {(a+b \tan (e+f x)) \left (2 \left (b^3 c^2+a^3 c d-3 a b^2 c d+3 a^2 b d^2\right )+2 d \left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \tan (e+f x)+2 b^3 \left (c^2+d^2\right ) \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^2} \, dx}{2 d \left (c^2+d^2\right )} \\ & = -\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d)^3 \left (2 a c d+b \left (c^2+3 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\int \frac {2 \left (8 a^3 b c d^3-8 a b^3 c d^3+a^4 d^2 \left (c^2-d^2\right )-6 a^2 b^2 d^2 \left (c^2-d^2\right )+b^4 \left (c^4+3 c^2 d^2\right )\right )+4 d^2 \left (a^2 c-b^2 c+2 a b d\right ) \left (2 a b c-a^2 d+b^2 d\right ) \tan (e+f x)+2 b^4 \left (c^2+d^2\right )^2 \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{2 d^2 \left (c^2+d^2\right )^2} \\ & = -\frac {\left (6 a^2 b^2 c \left (c^2-3 d^2\right )-b^4 c \left (c^2-3 d^2\right )-4 a^3 b d \left (3 c^2-d^2\right )+4 a b^3 d \left (3 c^2-d^2\right )-a^4 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d)^3 \left (2 a c d+b \left (c^2+3 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\left (4 a^3 b c \left (c^2-3 d^2\right )-4 a b^3 c \left (c^2-3 d^2\right )+6 a^2 b^2 d \left (3 c^2-d^2\right )-b^4 d \left (3 c^2-d^2\right )-a^4 \left (3 c^2 d-d^3\right )\right ) \int \tan (e+f x) \, dx}{\left (c^2+d^2\right )^3}+\frac {\left ((b c-a d)^2 \left (a^2 d^2 \left (3 c^2-d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right )\right ) \int \frac {1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d^2 \left (c^2+d^2\right )^3} \\ & = -\frac {\left (6 a^2 b^2 c \left (c^2-3 d^2\right )-b^4 c \left (c^2-3 d^2\right )-4 a^3 b d \left (3 c^2-d^2\right )+4 a b^3 d \left (3 c^2-d^2\right )-a^4 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (4 a^3 b c \left (c^2-3 d^2\right )-4 a b^3 c \left (c^2-3 d^2\right )+6 a^2 b^2 d \left (3 c^2-d^2\right )-b^4 d \left (3 c^2-d^2\right )-a^4 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d)^3 \left (2 a c d+b \left (c^2+3 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\left ((b c-a d)^2 \left (a^2 d^2 \left (3 c^2-d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right )\right ) \text {Subst}\left (\int \frac {1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^3 \left (c^2+d^2\right )^3 f} \\ & = -\frac {\left (6 a^2 b^2 c \left (c^2-3 d^2\right )-b^4 c \left (c^2-3 d^2\right )-4 a^3 b d \left (3 c^2-d^2\right )+4 a b^3 d \left (3 c^2-d^2\right )-a^4 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (4 a^3 b c \left (c^2-3 d^2\right )-4 a b^3 c \left (c^2-3 d^2\right )+6 a^2 b^2 d \left (3 c^2-d^2\right )-b^4 d \left (3 c^2-d^2\right )-a^4 \left (3 c^2 d-d^3\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac {(b c-a d)^2 \left (a^2 d^2 \left (3 c^2-d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3 f}-\frac {(b c-a d)^2 (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d)^3 \left (2 a c d+b \left (c^2+3 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 3.04 (sec) , antiderivative size = 247, normalized size of antiderivative = 0.61 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {(a+i b)^4 \log (i-\tan (e+f x))}{(-i c+d)^3}+\frac {(a-i b)^4 \log (i+\tan (e+f x))}{(i c+d)^3}+\frac {2 (b c-a d)^2 \left (-a^2 d^2 \left (-3 c^2+d^2\right )+2 a b c d \left (c^2+5 d^2\right )+b^2 \left (c^4+3 c^2 d^2+6 d^4\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3}-\frac {(b c-a d)^4}{d^3 \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}+\frac {4 (b c-a d)^3 \left (a c d+b \left (c^2+2 d^2\right )\right )}{d^3 \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}}{2 f} \]

[In]

Integrate[(a + b*Tan[e + f*x])^4/(c + d*Tan[e + f*x])^3,x]

[Out]

(((a + I*b)^4*Log[I - Tan[e + f*x]])/((-I)*c + d)^3 + ((a - I*b)^4*Log[I + Tan[e + f*x]])/(I*c + d)^3 + (2*(b*
c - a*d)^2*(-(a^2*d^2*(-3*c^2 + d^2)) + 2*a*b*c*d*(c^2 + 5*d^2) + b^2*(c^4 + 3*c^2*d^2 + 6*d^4))*Log[c + d*Tan
[e + f*x]])/(d^3*(c^2 + d^2)^3) - (b*c - a*d)^4/(d^3*(c^2 + d^2)*(c + d*Tan[e + f*x])^2) + (4*(b*c - a*d)^3*(a
*c*d + b*(c^2 + 2*d^2)))/(d^3*(c^2 + d^2)^2*(c + d*Tan[e + f*x])))/(2*f)

Maple [A] (verified)

Time = 0.69 (sec) , antiderivative size = 553, normalized size of antiderivative = 1.36

method result size
derivativedivides \(\frac {\frac {\frac {\left (-3 a^{4} c^{2} d +a^{4} d^{3}+4 a^{3} b \,c^{3}-12 a^{3} b c \,d^{2}+18 a^{2} b^{2} c^{2} d -6 a^{2} b^{2} d^{3}-4 a \,b^{3} c^{3}+12 a \,b^{3} c \,d^{2}-3 b^{4} c^{2} d +b^{4} d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{4} c^{3}-3 a^{4} c \,d^{2}+12 a^{3} b \,c^{2} d -4 a^{3} b \,d^{3}-6 a^{2} b^{2} c^{3}+18 a^{2} b^{2} c \,d^{2}-12 a \,b^{3} c^{2} d +4 a \,b^{3} d^{3}+b^{4} c^{3}-3 b^{4} c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}}{2 d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a^{4} c \,d^{4}-4 a^{3} b \,c^{2} d^{3}+4 a^{3} b \,d^{5}-12 a^{2} b^{2} c \,d^{4}+4 a \,b^{3} c^{4} d +12 a \,b^{3} c^{2} d^{3}-2 b^{4} c^{5}-4 b^{4} c^{3} d^{2}}{d^{3} \left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (3 a^{4} c^{2} d^{4}-a^{4} d^{6}-4 a^{3} b \,c^{3} d^{3}+12 a^{3} b \,d^{5} c -18 a^{2} b^{2} c^{2} d^{4}+6 a^{2} b^{2} d^{6}+4 a \,b^{3} c^{3} d^{3}-12 a \,b^{3} c \,d^{5}+b^{4} c^{6}+3 b^{4} c^{4} d^{2}+6 b^{4} c^{2} d^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3} d^{3}}}{f}\) \(553\)
default \(\frac {\frac {\frac {\left (-3 a^{4} c^{2} d +a^{4} d^{3}+4 a^{3} b \,c^{3}-12 a^{3} b c \,d^{2}+18 a^{2} b^{2} c^{2} d -6 a^{2} b^{2} d^{3}-4 a \,b^{3} c^{3}+12 a \,b^{3} c \,d^{2}-3 b^{4} c^{2} d +b^{4} d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{4} c^{3}-3 a^{4} c \,d^{2}+12 a^{3} b \,c^{2} d -4 a^{3} b \,d^{3}-6 a^{2} b^{2} c^{3}+18 a^{2} b^{2} c \,d^{2}-12 a \,b^{3} c^{2} d +4 a \,b^{3} d^{3}+b^{4} c^{3}-3 b^{4} c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}}{2 d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a^{4} c \,d^{4}-4 a^{3} b \,c^{2} d^{3}+4 a^{3} b \,d^{5}-12 a^{2} b^{2} c \,d^{4}+4 a \,b^{3} c^{4} d +12 a \,b^{3} c^{2} d^{3}-2 b^{4} c^{5}-4 b^{4} c^{3} d^{2}}{d^{3} \left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (3 a^{4} c^{2} d^{4}-a^{4} d^{6}-4 a^{3} b \,c^{3} d^{3}+12 a^{3} b \,d^{5} c -18 a^{2} b^{2} c^{2} d^{4}+6 a^{2} b^{2} d^{6}+4 a \,b^{3} c^{3} d^{3}-12 a \,b^{3} c \,d^{5}+b^{4} c^{6}+3 b^{4} c^{4} d^{2}+6 b^{4} c^{2} d^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3} d^{3}}}{f}\) \(553\)
norman \(\frac {\frac {\left (a^{4} c^{3}-3 a^{4} c \,d^{2}+12 a^{3} b \,c^{2} d -4 a^{3} b \,d^{3}-6 a^{2} b^{2} c^{3}+18 a^{2} b^{2} c \,d^{2}-12 a \,b^{3} c^{2} d +4 a \,b^{3} d^{3}+b^{4} c^{3}-3 b^{4} c \,d^{2}\right ) c^{2} x}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}+\frac {d^{2} \left (a^{4} c^{3}-3 a^{4} c \,d^{2}+12 a^{3} b \,c^{2} d -4 a^{3} b \,d^{3}-6 a^{2} b^{2} c^{3}+18 a^{2} b^{2} c \,d^{2}-12 a \,b^{3} c^{2} d +4 a \,b^{3} d^{3}+b^{4} c^{3}-3 b^{4} c \,d^{2}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}-\frac {5 a^{4} c^{2} d^{4}+a^{4} d^{6}-12 a^{3} b \,c^{3} d^{3}+4 a^{3} b \,d^{5} c +6 a^{2} b^{2} c^{4} d^{2}-18 a^{2} b^{2} c^{2} d^{4}+4 a \,b^{3} c^{5} d +20 a \,b^{3} c^{3} d^{3}-3 b^{4} c^{6}-7 b^{4} c^{4} d^{2}}{2 f \,d^{3} \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {2 \left (a^{4} c \,d^{4}-2 a^{3} b \,c^{2} d^{3}+2 a^{3} b \,d^{5}-6 a^{2} b^{2} c \,d^{4}+2 a \,b^{3} c^{4} d +6 a \,b^{3} c^{2} d^{3}-b^{4} c^{5}-2 b^{4} c^{3} d^{2}\right ) \tan \left (f x +e \right )}{f \,d^{2} \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {2 d \left (a^{4} c^{3}-3 a^{4} c \,d^{2}+12 a^{3} b \,c^{2} d -4 a^{3} b \,d^{3}-6 a^{2} b^{2} c^{3}+18 a^{2} b^{2} c \,d^{2}-12 a \,b^{3} c^{2} d +4 a \,b^{3} d^{3}+b^{4} c^{3}-3 b^{4} c \,d^{2}\right ) c x \tan \left (f x +e \right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}}{\left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {\left (3 a^{4} c^{2} d^{4}-a^{4} d^{6}-4 a^{3} b \,c^{3} d^{3}+12 a^{3} b \,d^{5} c -18 a^{2} b^{2} c^{2} d^{4}+6 a^{2} b^{2} d^{6}+4 a \,b^{3} c^{3} d^{3}-12 a \,b^{3} c \,d^{5}+b^{4} c^{6}+3 b^{4} c^{4} d^{2}+6 b^{4} c^{2} d^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right ) f \,d^{3}}-\frac {\left (3 a^{4} c^{2} d -a^{4} d^{3}-4 a^{3} b \,c^{3}+12 a^{3} b c \,d^{2}-18 a^{2} b^{2} c^{2} d +6 a^{2} b^{2} d^{3}+4 a \,b^{3} c^{3}-12 a \,b^{3} c \,d^{2}+3 b^{4} c^{2} d -b^{4} d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}\) \(952\)
risch \(\text {Expression too large to display}\) \(2372\)
parallelrisch \(\text {Expression too large to display}\) \(2668\)

[In]

int((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*(1/(c^2+d^2)^3*(1/2*(-3*a^4*c^2*d+a^4*d^3+4*a^3*b*c^3-12*a^3*b*c*d^2+18*a^2*b^2*c^2*d-6*a^2*b^2*d^3-4*a*b^
3*c^3+12*a*b^3*c*d^2-3*b^4*c^2*d+b^4*d^3)*ln(1+tan(f*x+e)^2)+(a^4*c^3-3*a^4*c*d^2+12*a^3*b*c^2*d-4*a^3*b*d^3-6
*a^2*b^2*c^3+18*a^2*b^2*c*d^2-12*a*b^3*c^2*d+4*a*b^3*d^3+b^4*c^3-3*b^4*c*d^2)*arctan(tan(f*x+e)))-1/2*(a^4*d^4
-4*a^3*b*c*d^3+6*a^2*b^2*c^2*d^2-4*a*b^3*c^3*d+b^4*c^4)/d^3/(c^2+d^2)/(c+d*tan(f*x+e))^2-(2*a^4*c*d^4-4*a^3*b*
c^2*d^3+4*a^3*b*d^5-12*a^2*b^2*c*d^4+4*a*b^3*c^4*d+12*a*b^3*c^2*d^3-2*b^4*c^5-4*b^4*c^3*d^2)/d^3/(c^2+d^2)^2/(
c+d*tan(f*x+e))+(3*a^4*c^2*d^4-a^4*d^6-4*a^3*b*c^3*d^3+12*a^3*b*c*d^5-18*a^2*b^2*c^2*d^4+6*a^2*b^2*d^6+4*a*b^3
*c^3*d^3-12*a*b^3*c*d^5+b^4*c^6+3*b^4*c^4*d^2+6*b^4*c^2*d^4)/(c^2+d^2)^3/d^3*ln(c+d*tan(f*x+e)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1247 vs. \(2 (404) = 808\).

Time = 0.46 (sec) , antiderivative size = 1247, normalized size of antiderivative = 3.07 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\text {Too large to display} \]

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/2*(b^4*c^6*d^2 + 4*a*b^3*c^5*d^3 - 4*a^3*b*c*d^7 - a^4*d^8 - (18*a^2*b^2 - 7*b^4)*c^4*d^4 + 20*(a^3*b - a*b^
3)*c^3*d^5 - (7*a^4 - 18*a^2*b^2)*c^2*d^6 + 2*((a^4 - 6*a^2*b^2 + b^4)*c^5*d^3 + 12*(a^3*b - a*b^3)*c^4*d^4 -
3*(a^4 - 6*a^2*b^2 + b^4)*c^3*d^5 - 4*(a^3*b - a*b^3)*c^2*d^6)*f*x - (3*b^4*c^6*d^2 - 4*a*b^3*c^5*d^3 - 12*a^3
*b*c*d^7 + a^4*d^8 - 3*(2*a^2*b^2 - 3*b^4)*c^4*d^4 + 4*(3*a^3*b - 7*a*b^3)*c^3*d^5 - 5*(a^4 - 6*a^2*b^2)*c^2*d
^6 - 2*((a^4 - 6*a^2*b^2 + b^4)*c^3*d^5 + 12*(a^3*b - a*b^3)*c^2*d^6 - 3*(a^4 - 6*a^2*b^2 + b^4)*c*d^7 - 4*(a^
3*b - a*b^3)*d^8)*f*x)*tan(f*x + e)^2 + (b^4*c^8 + 3*b^4*c^6*d^2 - 4*(a^3*b - a*b^3)*c^5*d^3 + 3*(a^4 - 6*a^2*
b^2 + 2*b^4)*c^4*d^4 + 12*(a^3*b - a*b^3)*c^3*d^5 - (a^4 - 6*a^2*b^2)*c^2*d^6 + (b^4*c^6*d^2 + 3*b^4*c^4*d^4 -
 4*(a^3*b - a*b^3)*c^3*d^5 + 3*(a^4 - 6*a^2*b^2 + 2*b^4)*c^2*d^6 + 12*(a^3*b - a*b^3)*c*d^7 - (a^4 - 6*a^2*b^2
)*d^8)*tan(f*x + e)^2 + 2*(b^4*c^7*d + 3*b^4*c^5*d^3 - 4*(a^3*b - a*b^3)*c^4*d^4 + 3*(a^4 - 6*a^2*b^2 + 2*b^4)
*c^3*d^5 + 12*(a^3*b - a*b^3)*c^2*d^6 - (a^4 - 6*a^2*b^2)*c*d^7)*tan(f*x + e))*log((d^2*tan(f*x + e)^2 + 2*c*d
*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) - (b^4*c^8 + 3*b^4*c^6*d^2 + 3*b^4*c^4*d^4 + b^4*c^2*d^6 + (b^4*c^6
*d^2 + 3*b^4*c^4*d^4 + 3*b^4*c^2*d^6 + b^4*d^8)*tan(f*x + e)^2 + 2*(b^4*c^7*d + 3*b^4*c^5*d^3 + 3*b^4*c^3*d^5
+ b^4*c*d^7)*tan(f*x + e))*log(1/(tan(f*x + e)^2 + 1)) - 2*(b^4*c^7*d + 4*a^3*b*d^8 - 3*(2*a^2*b^2 - b^4)*c^5*
d^3 + 4*(2*a^3*b - 3*a*b^3)*c^4*d^4 - (3*a^4 - 18*a^2*b^2 + 4*b^4)*c^3*d^5 - 12*(a^3*b - a*b^3)*c^2*d^6 + 3*(a
^4 - 4*a^2*b^2)*c*d^7 - 2*((a^4 - 6*a^2*b^2 + b^4)*c^4*d^4 + 12*(a^3*b - a*b^3)*c^3*d^5 - 3*(a^4 - 6*a^2*b^2 +
 b^4)*c^2*d^6 - 4*(a^3*b - a*b^3)*c*d^7)*f*x)*tan(f*x + e))/((c^6*d^5 + 3*c^4*d^7 + 3*c^2*d^9 + d^11)*f*tan(f*
x + e)^2 + 2*(c^7*d^4 + 3*c^5*d^6 + 3*c^3*d^8 + c*d^10)*f*tan(f*x + e) + (c^8*d^3 + 3*c^6*d^5 + 3*c^4*d^7 + c^
2*d^9)*f)

Sympy [F(-2)]

Exception generated. \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \]

[In]

integrate((a+b*tan(f*x+e))**4/(c+d*tan(f*x+e))**3,x)

[Out]

Exception raised: AttributeError >> 'NoneType' object has no attribute 'primitive'

Maxima [A] (verification not implemented)

none

Time = 0.45 (sec) , antiderivative size = 640, normalized size of antiderivative = 1.58 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c^{3} + 12 \, {\left (a^{3} b - a b^{3}\right )} c^{2} d - 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c d^{2} - 4 \, {\left (a^{3} b - a b^{3}\right )} d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {2 \, {\left (b^{4} c^{6} + 3 \, b^{4} c^{4} d^{2} - 4 \, {\left (a^{3} b - a b^{3}\right )} c^{3} d^{3} + 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + 2 \, b^{4}\right )} c^{2} d^{4} + 12 \, {\left (a^{3} b - a b^{3}\right )} c d^{5} - {\left (a^{4} - 6 \, a^{2} b^{2}\right )} d^{6}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} d^{3} + 3 \, c^{4} d^{5} + 3 \, c^{2} d^{7} + d^{9}} + \frac {{\left (4 \, {\left (a^{3} b - a b^{3}\right )} c^{3} - 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c^{2} d - 12 \, {\left (a^{3} b - a b^{3}\right )} c d^{2} + {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {3 \, b^{4} c^{6} - 4 \, a b^{3} c^{5} d - 4 \, a^{3} b c d^{5} - a^{4} d^{6} - {\left (6 \, a^{2} b^{2} - 7 \, b^{4}\right )} c^{4} d^{2} + 4 \, {\left (3 \, a^{3} b - 5 \, a b^{3}\right )} c^{3} d^{3} - {\left (5 \, a^{4} - 18 \, a^{2} b^{2}\right )} c^{2} d^{4} + 4 \, {\left (b^{4} c^{5} d - 2 \, a b^{3} c^{4} d^{2} + 2 \, b^{4} c^{3} d^{3} - 2 \, a^{3} b d^{6} + 2 \, {\left (a^{3} b - 3 \, a b^{3}\right )} c^{2} d^{4} - {\left (a^{4} - 6 \, a^{2} b^{2}\right )} c d^{5}\right )} \tan \left (f x + e\right )}{c^{6} d^{3} + 2 \, c^{4} d^{5} + c^{2} d^{7} + {\left (c^{4} d^{5} + 2 \, c^{2} d^{7} + d^{9}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{5} d^{4} + 2 \, c^{3} d^{6} + c d^{8}\right )} \tan \left (f x + e\right )}}{2 \, f} \]

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/2*(2*((a^4 - 6*a^2*b^2 + b^4)*c^3 + 12*(a^3*b - a*b^3)*c^2*d - 3*(a^4 - 6*a^2*b^2 + b^4)*c*d^2 - 4*(a^3*b -
a*b^3)*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + 2*(b^4*c^6 + 3*b^4*c^4*d^2 - 4*(a^3*b - a*b^3)*c^3
*d^3 + 3*(a^4 - 6*a^2*b^2 + 2*b^4)*c^2*d^4 + 12*(a^3*b - a*b^3)*c*d^5 - (a^4 - 6*a^2*b^2)*d^6)*log(d*tan(f*x +
 e) + c)/(c^6*d^3 + 3*c^4*d^5 + 3*c^2*d^7 + d^9) + (4*(a^3*b - a*b^3)*c^3 - 3*(a^4 - 6*a^2*b^2 + b^4)*c^2*d -
12*(a^3*b - a*b^3)*c*d^2 + (a^4 - 6*a^2*b^2 + b^4)*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 +
 d^6) + (3*b^4*c^6 - 4*a*b^3*c^5*d - 4*a^3*b*c*d^5 - a^4*d^6 - (6*a^2*b^2 - 7*b^4)*c^4*d^2 + 4*(3*a^3*b - 5*a*
b^3)*c^3*d^3 - (5*a^4 - 18*a^2*b^2)*c^2*d^4 + 4*(b^4*c^5*d - 2*a*b^3*c^4*d^2 + 2*b^4*c^3*d^3 - 2*a^3*b*d^6 + 2
*(a^3*b - 3*a*b^3)*c^2*d^4 - (a^4 - 6*a^2*b^2)*c*d^5)*tan(f*x + e))/(c^6*d^3 + 2*c^4*d^5 + c^2*d^7 + (c^4*d^5
+ 2*c^2*d^7 + d^9)*tan(f*x + e)^2 + 2*(c^5*d^4 + 2*c^3*d^6 + c*d^8)*tan(f*x + e)))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1038 vs. \(2 (404) = 808\).

Time = 1.21 (sec) , antiderivative size = 1038, normalized size of antiderivative = 2.56 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left (a^{4} c^{3} - 6 \, a^{2} b^{2} c^{3} + b^{4} c^{3} + 12 \, a^{3} b c^{2} d - 12 \, a b^{3} c^{2} d - 3 \, a^{4} c d^{2} + 18 \, a^{2} b^{2} c d^{2} - 3 \, b^{4} c d^{2} - 4 \, a^{3} b d^{3} + 4 \, a b^{3} d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {{\left (4 \, a^{3} b c^{3} - 4 \, a b^{3} c^{3} - 3 \, a^{4} c^{2} d + 18 \, a^{2} b^{2} c^{2} d - 3 \, b^{4} c^{2} d - 12 \, a^{3} b c d^{2} + 12 \, a b^{3} c d^{2} + a^{4} d^{3} - 6 \, a^{2} b^{2} d^{3} + b^{4} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {2 \, {\left (b^{4} c^{6} + 3 \, b^{4} c^{4} d^{2} - 4 \, a^{3} b c^{3} d^{3} + 4 \, a b^{3} c^{3} d^{3} + 3 \, a^{4} c^{2} d^{4} - 18 \, a^{2} b^{2} c^{2} d^{4} + 6 \, b^{4} c^{2} d^{4} + 12 \, a^{3} b c d^{5} - 12 \, a b^{3} c d^{5} - a^{4} d^{6} + 6 \, a^{2} b^{2} d^{6}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{6} d^{3} + 3 \, c^{4} d^{5} + 3 \, c^{2} d^{7} + d^{9}} - \frac {3 \, b^{4} c^{6} d \tan \left (f x + e\right )^{2} + 9 \, b^{4} c^{4} d^{3} \tan \left (f x + e\right )^{2} - 12 \, a^{3} b c^{3} d^{4} \tan \left (f x + e\right )^{2} + 12 \, a b^{3} c^{3} d^{4} \tan \left (f x + e\right )^{2} + 9 \, a^{4} c^{2} d^{5} \tan \left (f x + e\right )^{2} - 54 \, a^{2} b^{2} c^{2} d^{5} \tan \left (f x + e\right )^{2} + 18 \, b^{4} c^{2} d^{5} \tan \left (f x + e\right )^{2} + 36 \, a^{3} b c d^{6} \tan \left (f x + e\right )^{2} - 36 \, a b^{3} c d^{6} \tan \left (f x + e\right )^{2} - 3 \, a^{4} d^{7} \tan \left (f x + e\right )^{2} + 18 \, a^{2} b^{2} d^{7} \tan \left (f x + e\right )^{2} + 2 \, b^{4} c^{7} \tan \left (f x + e\right ) + 8 \, a b^{3} c^{6} d \tan \left (f x + e\right ) + 6 \, b^{4} c^{5} d^{2} \tan \left (f x + e\right ) - 32 \, a^{3} b c^{4} d^{3} \tan \left (f x + e\right ) + 56 \, a b^{3} c^{4} d^{3} \tan \left (f x + e\right ) + 22 \, a^{4} c^{3} d^{4} \tan \left (f x + e\right ) - 132 \, a^{2} b^{2} c^{3} d^{4} \tan \left (f x + e\right ) + 28 \, b^{4} c^{3} d^{4} \tan \left (f x + e\right ) + 72 \, a^{3} b c^{2} d^{5} \tan \left (f x + e\right ) - 48 \, a b^{3} c^{2} d^{5} \tan \left (f x + e\right ) - 2 \, a^{4} c d^{6} \tan \left (f x + e\right ) + 12 \, a^{2} b^{2} c d^{6} \tan \left (f x + e\right ) + 8 \, a^{3} b d^{7} \tan \left (f x + e\right ) + 4 \, a b^{3} c^{7} + 6 \, a^{2} b^{2} c^{6} d - b^{4} c^{6} d - 24 \, a^{3} b c^{5} d^{2} + 36 \, a b^{3} c^{5} d^{2} + 14 \, a^{4} c^{4} d^{3} - 66 \, a^{2} b^{2} c^{4} d^{3} + 11 \, b^{4} c^{4} d^{3} + 28 \, a^{3} b c^{3} d^{4} - 16 \, a b^{3} c^{3} d^{4} + 3 \, a^{4} c^{2} d^{5} + 4 \, a^{3} b c d^{6} + a^{4} d^{7}}{{\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}^{2}}}{2 \, f} \]

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/2*(2*(a^4*c^3 - 6*a^2*b^2*c^3 + b^4*c^3 + 12*a^3*b*c^2*d - 12*a*b^3*c^2*d - 3*a^4*c*d^2 + 18*a^2*b^2*c*d^2 -
 3*b^4*c*d^2 - 4*a^3*b*d^3 + 4*a*b^3*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (4*a^3*b*c^3 - 4*a*b
^3*c^3 - 3*a^4*c^2*d + 18*a^2*b^2*c^2*d - 3*b^4*c^2*d - 12*a^3*b*c*d^2 + 12*a*b^3*c*d^2 + a^4*d^3 - 6*a^2*b^2*
d^3 + b^4*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + 2*(b^4*c^6 + 3*b^4*c^4*d^2 - 4*a^
3*b*c^3*d^3 + 4*a*b^3*c^3*d^3 + 3*a^4*c^2*d^4 - 18*a^2*b^2*c^2*d^4 + 6*b^4*c^2*d^4 + 12*a^3*b*c*d^5 - 12*a*b^3
*c*d^5 - a^4*d^6 + 6*a^2*b^2*d^6)*log(abs(d*tan(f*x + e) + c))/(c^6*d^3 + 3*c^4*d^5 + 3*c^2*d^7 + d^9) - (3*b^
4*c^6*d*tan(f*x + e)^2 + 9*b^4*c^4*d^3*tan(f*x + e)^2 - 12*a^3*b*c^3*d^4*tan(f*x + e)^2 + 12*a*b^3*c^3*d^4*tan
(f*x + e)^2 + 9*a^4*c^2*d^5*tan(f*x + e)^2 - 54*a^2*b^2*c^2*d^5*tan(f*x + e)^2 + 18*b^4*c^2*d^5*tan(f*x + e)^2
 + 36*a^3*b*c*d^6*tan(f*x + e)^2 - 36*a*b^3*c*d^6*tan(f*x + e)^2 - 3*a^4*d^7*tan(f*x + e)^2 + 18*a^2*b^2*d^7*t
an(f*x + e)^2 + 2*b^4*c^7*tan(f*x + e) + 8*a*b^3*c^6*d*tan(f*x + e) + 6*b^4*c^5*d^2*tan(f*x + e) - 32*a^3*b*c^
4*d^3*tan(f*x + e) + 56*a*b^3*c^4*d^3*tan(f*x + e) + 22*a^4*c^3*d^4*tan(f*x + e) - 132*a^2*b^2*c^3*d^4*tan(f*x
 + e) + 28*b^4*c^3*d^4*tan(f*x + e) + 72*a^3*b*c^2*d^5*tan(f*x + e) - 48*a*b^3*c^2*d^5*tan(f*x + e) - 2*a^4*c*
d^6*tan(f*x + e) + 12*a^2*b^2*c*d^6*tan(f*x + e) + 8*a^3*b*d^7*tan(f*x + e) + 4*a*b^3*c^7 + 6*a^2*b^2*c^6*d -
b^4*c^6*d - 24*a^3*b*c^5*d^2 + 36*a*b^3*c^5*d^2 + 14*a^4*c^4*d^3 - 66*a^2*b^2*c^4*d^3 + 11*b^4*c^4*d^3 + 28*a^
3*b*c^3*d^4 - 16*a*b^3*c^3*d^4 + 3*a^4*c^2*d^5 + 4*a^3*b*c*d^6 + a^4*d^7)/((c^6*d^2 + 3*c^4*d^4 + 3*c^2*d^6 +
d^8)*(d*tan(f*x + e) + c)^2))/f

Mupad [B] (verification not implemented)

Time = 12.20 (sec) , antiderivative size = 578, normalized size of antiderivative = 1.42 \[ \int \frac {(a+b \tan (e+f x))^4}{(c+d \tan (e+f x))^3} \, dx=-\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {d^6\,\left (a^4-6\,a^2\,b^2\right )-c^2\,\left (d^4\,\left (3\,a^4-18\,a^2\,b^2+6\,b^4\right )-3\,b^4\,d^4\right )+b^4\,d^6-c^3\,d^3\,\left (4\,a\,b^3-4\,a^3\,b\right )+c\,d^5\,\left (12\,a\,b^3-12\,a^3\,b\right )}{c^6\,d^3+3\,c^4\,d^5+3\,c^2\,d^7+d^9}-\frac {b^4}{d^3}\right )}{f}-\frac {\frac {5\,a^4\,c^2\,d^4+a^4\,d^6-12\,a^3\,b\,c^3\,d^3+4\,a^3\,b\,c\,d^5+6\,a^2\,b^2\,c^4\,d^2-18\,a^2\,b^2\,c^2\,d^4+4\,a\,b^3\,c^5\,d+20\,a\,b^3\,c^3\,d^3-3\,b^4\,c^6-7\,b^4\,c^4\,d^2}{2\,d^3\,\left (c^4+2\,c^2\,d^2+d^4\right )}-\frac {2\,\mathrm {tan}\left (e+f\,x\right )\,\left (-a^4\,c\,d^4+2\,a^3\,b\,c^2\,d^3-2\,a^3\,b\,d^5+6\,a^2\,b^2\,c\,d^4-2\,a\,b^3\,c^4\,d-6\,a\,b^3\,c^2\,d^3+b^4\,c^5+2\,b^4\,c^3\,d^2\right )}{d^2\,\left (c^4+2\,c^2\,d^2+d^4\right )}}{f\,\left (c^2+2\,c\,d\,\mathrm {tan}\left (e+f\,x\right )+d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a^4-a^3\,b\,4{}\mathrm {i}-6\,a^2\,b^2+a\,b^3\,4{}\mathrm {i}+b^4\right )}{2\,f\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (a^4\,1{}\mathrm {i}-4\,a^3\,b-a^2\,b^2\,6{}\mathrm {i}+4\,a\,b^3+b^4\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^3-c^2\,d\,3{}\mathrm {i}+3\,c\,d^2+d^3\,1{}\mathrm {i}\right )} \]

[In]

int((a + b*tan(e + f*x))^4/(c + d*tan(e + f*x))^3,x)

[Out]

(log(tan(e + f*x) + 1i)*(a*b^3*4i - a^3*b*4i + a^4 + b^4 - 6*a^2*b^2))/(2*f*(c*d^2*3i - 3*c^2*d - c^3*1i + d^3
)) - ((a^4*d^6 - 3*b^4*c^6 + 5*a^4*c^2*d^4 - 7*b^4*c^4*d^2 + 20*a*b^3*c^3*d^3 - 12*a^3*b*c^3*d^3 - 18*a^2*b^2*
c^2*d^4 + 6*a^2*b^2*c^4*d^2 + 4*a*b^3*c^5*d + 4*a^3*b*c*d^5)/(2*d^3*(c^4 + d^4 + 2*c^2*d^2)) - (2*tan(e + f*x)
*(b^4*c^5 - 2*a^3*b*d^5 - a^4*c*d^4 + 2*b^4*c^3*d^2 - 6*a*b^3*c^2*d^3 + 6*a^2*b^2*c*d^4 + 2*a^3*b*c^2*d^3 - 2*
a*b^3*c^4*d))/(d^2*(c^4 + d^4 + 2*c^2*d^2)))/(f*(c^2 + d^2*tan(e + f*x)^2 + 2*c*d*tan(e + f*x))) - (log(c + d*
tan(e + f*x))*((d^6*(a^4 - 6*a^2*b^2) - c^2*(d^4*(3*a^4 + 6*b^4 - 18*a^2*b^2) - 3*b^4*d^4) + b^4*d^6 - c^3*d^3
*(4*a*b^3 - 4*a^3*b) + c*d^5*(12*a*b^3 - 12*a^3*b))/(d^9 + 3*c^2*d^7 + 3*c^4*d^5 + c^6*d^3) - b^4/d^3))/f + (l
og(tan(e + f*x) - 1i)*(4*a*b^3 - 4*a^3*b + a^4*1i + b^4*1i - a^2*b^2*6i))/(2*f*(3*c*d^2 - c^2*d*3i - c^3 + d^3
*1i))